<?php
$mypage = 'rex_lang';

$error = '';

/* backup table contents */
require_once($addonPath = $REX['INCLUDE_PATH'].'/addons/'.$mypage .'/functions/backup.inc.php');
$backup = '';
$backup .= datadump('rex_393_language');
$backup .= datadump('rex_393_domain');

/* backup file for uninstall routine */
$backupFile = $REX['INCLUDE_PATH'] . "/addons/" . $mypage .'/backup/tablebackup.sql';
	
if (!rex_put_file_contents($backupFile,$backup))
	$error = 'error on creating backup file';

if ($error == '') {
   $qry = 'DROP TABLE `rex_393_language`,`rex_393_domain`;';
   $sql = new rex_sql();
   if($sql->setQuery($qry)==0)
   {
	   	$error="error on deleting tables";
   }
}
$REX['ADDON']['install'][$mypage] = 0;
?>